/**
 * 封装了一下validform，提供了更丰富的datatype
 * @author 姜友瑶
 * 2016-06-24
 */
var MValidform=function() {

	"use strict";// 严格模式
	return {
		
		// 验证一个form表格
		
		validform : function(formSelecter) {
			
			var exForm = $(formSelecter).Validform({
				
				tiptype : 3,
				//扩展自定义dattype
				datatype : {
					
					//正浮点2位小数
					"pice" : function(gets, obj, curform, regxp) {
						if (obj.val() == "")
							return false;
						if(!isNaN(obj.val())){
							return	regx.test(obj.val())
						}else{
							return false;
						}
					},
					
					//正负int都可以
					"zfn" : function(gets, obj, curform, regxp) {
						
						if (obj.val() == "")
							return false;
						if(!isNaN(obj.val())){
							return	zfzs.test(obj.val());
						}else{
							return false;
						}
					},
					
					//百分比
					"hl" : function(gets, obj, curform, regxp) {
						if (obj.val() == "")
							return false;
						if(!isNaN(obj.val())){
							var isHl=(parseFloat(obj.val()))>=0 &&(parseFloat(obj.val()))<=100;
							return	regx.test(obj.val()) && isHl ;
						}else{
							return false;
						}
					},
					
				},
				
			});
			return exForm;
		},
		
		
	}
}();
